﻿@model Titul.Help.Models.Product
@{
    ViewBag.Title = Model.Name;
    Layout = MVC.Shared.Views._Layout;
}
<h2 class="help-title">@ViewBag.Title</h2>
<div class="btn-group pull-right">
    @Html.ActionLink("Изменить", MVC.Products.Edit(id: Model.Id), new { @class = "btn btn-default", @id = "bth-redact" })
</div>
<section id="appointment">
    <div class="row">
        <div class="col-md-3">
            <img alt="" src="@Model.ImageUrl" />
        </div>
        <div class="col-md-9">
            <h4 class="help-title"><strong>Назначение</strong></h4>
            <div class="em093 text-muted">
                @Html.Raw(Model.Appointment)
            </div>
        </div>
    </div>
</section>

<div role="tabpanel">
    <ul class="nav nav-tabs" id="helpTab" role="tablist">
        <li role="presentation">
            <a href="#full-desc-tab" data-toggle="tab" aria-controls="full-desc-tab">Описание</a>
        </li>
        <li role="presentation">
            <a href="#articles" data-toggle="tab" aria-controls="articles">Справка</a>
        </li>
        <li role="presentation">
            <a href="#support" data-toggle="tab" aria-controls="support">Поддержка</a>
        </li>
        <li role="presentation">
            <a href="#versions" data-toggle="tab" aria-controls="versions">История версий</a>
        </li>
    </ul>
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane fade" id="full-desc-tab">
            @Html.Raw(Model.Description)
        </div>
        <div role="tabpanel" class="tab-pane fade" id="articles">
            @Html.Action(MVC.Articles.Contents(productId: Model.Id))
        </div>
        <div role="tabpanel" class="tab-pane fade" id="support">
            @Html.Action(MVC.Support.Edit())
        </div>
        <div role="tabpanel" class="tab-pane fade" id="versions">
            <div class="btn-group pull-right">
                @Html.ActionLink("Добавить", MVC.Versions.Edit(productSeoUrl: Model.SeoUrl), new { @class = "btn btn-default" })
            </div>
            <h3 class="help-title"><strong>История версий @Model.Name</strong></h3>
            @Html.Partial("~/Views/Temp/_HistoryChangeExample.cshtml")
        </div>
    </div>
</div>
@section scripts{
    <script type="text/javascript">
        $(function () {
            $('#helpTab a:first').tab('show');

            $('#helpTab a').click(function (e) {
                e.preventDefault()
                $(this).tab('show')
            })

            $('#helpTab a[href="#articles"]').click(function () {
                $('#appointment').slideToggle('fast');
            });
            $('#helpTab a').click(function () {
                var display = $('#appointment').css('display');
                if (display == 'block') return;

                $('#appointment').slideDown('fast');
            });
        });
    </script>

    @Scripts.Render("~/bundles/unobtrusive")
    @Scripts.Render("~/bundles/ckeditor")
    <script type="text/javascript">
        CKEDITOR.replaceAll();
    </script>

}
